package com.wnx.job.modules.pms.controller;


import com.wnx.job.common.api.Const;
import com.wnx.job.common.api.ResultData;
import com.wnx.job.domain.CascadeNode;
import com.wnx.job.modules.pms.service.PmsIndustryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wangnaixing
 * @since 2021-12-17
 */
@RestController
@RequestMapping("/pms/pmsIndustry")
public class PmsIndustryController {

    @Resource
    private PmsIndustryService industryService;

    /**
     * 获取行业树
     * @return
     */
    @GetMapping("/getIndustryTree")
    @ApiOperation("获取行业树")
    public ResultData<List<CascadeNode>> getIndustryTree(){

        //调用服务层，获取行业树
        List<CascadeNode> industryTree =  industryService.getIndustryTree();

        //返回结果集对象
        return ResultData.success(Const.QUERY_INDUSTRY_TYPE_TREE_SUCCESS,industryTree);
    }


}

